/**
 * 
 */
package swingPractice;

import java.awt.Graphics;

/**
 * @author p@!
 *
 */
public class Room {
	
	public Block[] [] block;
	
//	map length and width decleration and initialization....
//	User data entry
	public int mapWidth = 10;
	public int mapHeight = 8;
//	each block/button size
//	to be varied according to the rows and cols of user value entry
	public int blockSize = 80;
	
	
	public Room(){
		define();
	}
	
	private void define() {
		// TODO Auto-generated method stub
//		create a matrix of rectangles with no of rows & cols given by user
		block = new Block [mapHeight][mapWidth];
		
		for(int y=0; y<block.length; y++){
			for(int x=0; x<block[0].length; x++){
				
				// x*blockSize = begining x vertex of block
				// y*blockSize = begining y vertex of block
				// blockSize   = width of the block
				// blockSize   = length of the block
				// 0 - createId/groundId  0 - represents block/ground
				// 0 - airId inital value
//				block[y][x] = new Block( (x*blockSize), (y*blockSize), (blockSize), (blockSize), 0, 0);
				
				block[y][x] = new Block( ((PanelPractice.myWidth/2) - ((mapWidth*blockSize)/2) + (x*blockSize)), ((PanelPractice.myHeight/2) - ((mapHeight*blockSize)/2) + (y*blockSize)), (blockSize), (blockSize), 0, 0);
				// F ing figure it out how to position this shit,,,,,!!!!!!!!
				/*
				 * 44 - 1 - divide the width and height of the screen to adjust the
				 *            game spread sheet ?????? ]:)
				*/
			}
		}
	}

	public void drawArena(Graphics gp){
		
		for(int y=0; y<block.length; y++){
			for(int x=0; x<block[0].length; x++){
				block[y][x].draw(gp);
			}
		}
		
	}

	public void physic() {
		
	}

}
